Skip to content

Conversation

@cirras
Copy link
Collaborator

@cirras cirras commented Nov 13, 2024

This PR fixes a name resolution issue where explicit references to default array properties failed to resolve to overloads from ancestor types.

Fixes #78.

@cirras cirras requested a review from fourls November 13, 2024 03:46
Copy link
Collaborator

@fourls fourls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Test cases make sense and everything passes.

@cirras cirras merged commit 4b72bad into master Nov 20, 2024
2 checks passed
@fourls fourls deleted the default_property_parent_overloading branch November 20, 2024 22:39
cirras added a commit that referenced this pull request Dec 6, 2024
#313 introduced a regression in type resolution for plain array
properties.

We started erroneously calling `addResolvedDeclaration()` before
resolving array properties, where before we would exit immediately
and return to argument disambiguation on the array accessor.

The effect was a subtle breakage of the type resolution around array
properties. Take, for example, the expression `Foo.Bar[0]`, where `Bar`
is an array property returning `string`. The old behavior would yield
type `string`, while the new behavior would yield type `Char` due to the
premature `addResolvedDeclaration()` call updating the `currentType` to
`string` before the array accessor was processed.
cirras added a commit that referenced this pull request Dec 6, 2024
#313 introduced a regression in type resolution for plain array
properties.

We started erroneously calling `addResolvedDeclaration()` before
resolving array properties, where before we would exit immediately
and return to argument disambiguation on the array accessor.

The effect was a subtle breakage of the type resolution around array
properties. Take, for example, the expression `Foo.Bar[0]`, where `Bar`
is an array property returning `string`. The old behavior would yield
type `string`, while the new behavior would yield type `Char` due to the
premature `addResolvedDeclaration()` call updating the `currentType` to
`string` before the array accessor was processed.
cirras added a commit that referenced this pull request Dec 6, 2024
#313 introduced a regression in type resolution for plain array
properties.

We started erroneously calling `addResolvedDeclaration()` before
resolving array properties, where before we would exit immediately
and return to argument disambiguation on the array accessor.

The effect was a subtle breakage of the type resolution around array
properties. Take, for example, the expression `Foo.Bar[0]`, where `Bar`
is an array property returning `string`. The old behavior would yield
type `string`, while the new behavior would yield type `Char` due to the
premature `addResolvedDeclaration()` call updating the `currentType` to
`string` before the array accessor was processed.
cirras added a commit that referenced this pull request Dec 6, 2024
#313 introduced a regression in type resolution for plain array
properties.

We started erroneously calling `addResolvedDeclaration()` before
resolving array properties, where before we would exit immediately
and return to argument disambiguation on the array accessor.

The effect was a subtle breakage of the type resolution around array
properties. Take, for example, the expression `Foo.Bar[0]`, where `Bar`
is an array property returning `string`. The old behavior would yield
type `string`, while the new behavior would yield type `Char` due to the
premature `addResolvedDeclaration()` call updating the `currentType` to
`string` before the array accessor was processed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default property parent overloading not handled

3 participants